<template>
	<div class="r__radio">
		<label>
			<input type="radio" name="radio" :value="label" :checked="value==label" @change="change"/>
			<span><slot/></span>
		</label>
	</div>
</template>

<script>
	export default{
		name:"radio",
		props:{
			value:{},
			label:{
				type:String,
				default:""
			}
		},
		methods:{
			change(e){
				this.$emit('input',this.label);
				this.$emit('change',this.label);
			}
		}
	}
</script>

<style>
	.r__radio{
		display: inline-block;
		margin-right: 30px;
	}
	
	.r__radio label span{
		display: flex;
		justify-content: flex-start;
		align-items: center;
		cursor: pointer;
	}
	
	.r__radio input[type=radio]{
		display: none;
	}
	
	.r__radio span{
		display: -moz-box;
		font-size: 14px;
		font-weight: normal;
		line-height: 15px;
		box-sizing: border-box;
		vertical-align: bottom;
		color: #606266;
		/* float: left; */
	}
	
	.r__radio span::before{
		content: '';
		display: inline-block;
		box-sizing: border-box;
		width: 14px;
		height: 14px;
		margin-right: 5px;
		border: 3px solid #1F2D3D;
		border-radius: 100%;
		border: 1px solid #DCDFE6;
	}
	
	.r__radio input[type=radio]:checked + span::before{
		border: 5px solid #409EFF;
	}
	
	.r__radio input[type=radio]:checked + span{
		color: #409EFF;
	}
</style>
